/*
	Name:T3
	Copyright:Take it at will
	Author:Rodney
	Date: 
	Description:
*/
#include<stdio.h>
#include<stdlib.h>

int main(int argc,char *argv[])
{
	int m,n,i;
	char str[256];
	FILE *fp;
	
	if(argc != 2 && argc != 4)
	{
		puts("please input correctly");
		exit(0);
	}
	if(argc == 4)
	{
		m = atoi(argv[2]);
		n = atoi(argv[3]);
		if(m>n)
		{
			puts("error");
			exit(0);
		}
	}
	if((fp = fopen(argv[1],"r")) == NULL)
	{
		puts("fail to open the file");
		exit(0);
	}
	
	if(argc == 4)
	{
		int tag=1;
		for(i=1;i<m;i++)
			if((fgets(str,256,fp)) == NULL)
			{
				tag=0;
				break;
			}
		for(;i<=n && fgets(str,256,fp) != NULL;i++)
			printf("%s",str);
	}
	else
	{
		while(fgets(str,256,fp) != NULL)
			printf("%s",str);
	}
}

